Skip to content

fix(server): settle Codex turns when the app-server exits - #167

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
codex/report-codex-app-server-exit
Nov 19, 2026
Merged

ScriptedAlchemy merged 2 commits into
mainfrom
codex/report-codex-app-server-exit

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Problem

A Codex app-server can exit while turns are still active. T3 previously tried to interrupt the dead process and could leave native turns marked running. A descendant retaining stdout could also prevent T3 from observing the exit at all, stranding outstanding requests and the active turn.

Changes

  • Report confirmed process exit from the Codex adapter and settle the active provider turn in the same guarded write that fails the run. Preserve terminal snapshots already received.
  • Keep the interrupt/recovery path when a failed stream does not prove the process exited.
  • Observe the owned process's exit independently of stdout closure. Allow 250 ms for final output, then finish the protocol input, including a final JSONL record without a newline.
  • Preserve final RPC replies, notifications, exit status and stderr diagnostics. Include the exit status in the thread banner while keeping raw stderr in server logs.

Validation

The inherited-stdout regression failed before the transport fix and passes afterward. It covers ordinary EOF, an open inherited pipe, and signal exit, with final replies and notifications in each case.

  • All 65 tests across the five Codex transport package suites passed.
  • The changed-file gate's stdio and context-budget suites passed separately: 24 tests.
  • The transport package's direct Effect/TypeScript check passed.
  • A real Node parent/descendant probe confirmed exit-code 0 is reported, final output and stderr are retained, and the owned scope closes even while descendants retain the pipes.
  • Formatting, lint, both unused-code checks, and the native memory addon build passed.
  • The standard vp run check:changed HEAD --concurrency 1 command was run. Its cached typecheck launcher cannot initialize the workspace's nested seccomp supervisor. Cargo was initially absent from that command's PATH; the native build and the skipped test step were subsequently run successfully with the installed toolchain.

The earlier run-finalization regressions and full hosted CI passed on the preceding head. Hosted CI is being rerun for this transport follow-up.

Model and harness: GPT-6.2 Astra in Codex for the original fix; GPT-6 Astra Pro in the ChatGPT shared workspace with delegated review for the deeper inspection.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dec13c5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Observe process exit independently of stdout EOF and allow a bounded final drain. A descendant retaining the pipe no longer strands active requests or turn termination. Cover final replies, unterminated notifications, and signal exits.
@ScriptedAlchemy
ScriptedAlchemy merged commit d82d5be into main Nov 19, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant